import request from '@/utils/request'

/**
 * @description: 获取员工列表
 * @param {*} params {page:当前页,size：每页条数}
 * @return {*}
 */
export function getEmployeeList(page, size) {
  return request({
    url: '/sys/user',
    params: { page, size }
  })
}

// 新增员工
export const addUser = (data) => {
  return request.post('/sys/user', data)
}

// 获取员工基本信息
export const getUserBasicInfo = (id) => {
  return request.get(`/sys/user/${id}`)
}

// 获取员工个人信息
export const getUserInfo = (id) => {
  return request.get(`/employees/${id}/personalInfo`)
}

// 获取员工岗位信息
export const getUserJobInfo = (id) => {
  return request.get(`/employees/${id}/jobs`)
}

// 删除员工
export const delUser = (id) => {
  return request.delete(`/sys/user/${id}`)
}

// 批量导入员工信息
export const toLead = (data) => {
  return request.post('/sys/user/batch', data)
}

// 修改员工基本信息
export const updateUserInfo = (data) => {
  return request.put(`/sys/user/${data.id}`, data)
}
